//app.js
App({
  globalData: { //全局变量
    inavHeight: 0,
    inavTop: 0,
    userInfo: wx.getStorageSync('userInfo') ? JSON.parse(wx.getStorageSync('userInfo')) : null,
    token: wx.getStorageSync('token') || ''
  },
  onload() { //不会拿到由onLaunch获取的值
  },
  onLaunch: function () { //小程序启动时触发onLaunch
    var menubtn = wx.getMenuButtonBoundingClientRect();
    this.globalData.inavHeight = menubtn.height;
    this.globalData.inavTop = menubtn.top;
  }
})